#! /bin/bash

# Author : Vincent
########
# Goal of this script : to download the ECOM website. It is a subpart of
#   deploy_ecom.sh which should be included in the same directory.
########

echo "============================================================"
echo "== Installer ECOM"
echo "============================================================"


if [ ! -f /usr/bin/svn ] ; then
    sudo apt-get install -y -qq subversion > /dev/null && echo "subversion téléchargé."    
fi

if [ ! -f /usr/bin/mvn ] ; then
    echo "=========    Installation maven2 ..."
    sudo apt-get install -y maven2 > /dev/null && echo "Maven2 téléchargé."
fi



echo "======="
echo "== Checkout svn ..."
echo "======="
svn checkout -q http://ecom-coloc.googlecode.com/svn/ ecom-coloc-read-only && echo "...checkout OK."
cd ecom-coloc-read-only/branches/

echo "=========="
echo "Compilation mvn ..."
echo "=========="

mvn install -q && cp ear/target/ear.ear ~/.jonas_base/deploy/
cd ../..
